<?php
namespace app\index\controller;

use think\Controller;
use app\admin\model\Category;

class Base extends Controller
{
    //初始化方法
    public function _initialize()
    {
      //获取导航数据,赋值模板
      $this->getNav();

    }
    
    //通过数据模型类获取顶部导航菜单数组
    public function getNav()
    {
        $res = Category::getNav();
        $this->assign('NAVS',$res);
    }
}